import 'package:flutter_test/flutter_test.dart';
import 'package:enya_app_setting/enya_app_setting.dart';
import 'package:enya_app_setting/enya_app_setting_platform_interface.dart';
import 'package:enya_app_setting/enya_app_setting_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockEnyaAppSettingPlatform
    with MockPlatformInterfaceMixin
    implements EnyaAppSettingPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final EnyaAppSettingPlatform initialPlatform = EnyaAppSettingPlatform.instance;

  test('$MethodChannelEnyaAppSetting is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelEnyaAppSetting>());
  });

  test('getPlatformVersion', () async {
    EnyaAppSetting enyaAppSettingPlugin = EnyaAppSetting();
    MockEnyaAppSettingPlatform fakePlatform = MockEnyaAppSettingPlatform();
    EnyaAppSettingPlatform.instance = fakePlatform;

    expect(await enyaAppSettingPlugin.getPlatformVersion(), '42');
  });
}
